﻿<%@ Page Language="C#" MasterPageFile="~/admin/adminMasterPage.master" AutoEventWireup="true"
    CodeFile="AdminAccounts.aspx.cs" Inherits="admin_AdminAccounts" Title="Untitled Page" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>Admin's Accounts</title>
    <link rel="stylesheet" type="text/css" media="screen,projection,print" href="css/layout2_setup.css" />
    <link rel="stylesheet" type="text/css" media="screen,projection,print" href="css/layout2_text.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">
  
    <h1 class="block">
        Quản lý tài khoản quản trị viên:
    </h1>
    
    <telerik:RadAjaxPanel ID="pnlAddAdmin" runat="server" Width="900px" >
        <asp:TextBox ID="txtAdminName" runat="server" CssClass="field" SelectionOnFocus="SelectAll" ValidationGroup="add" >
        </asp:TextBox>
        <asp:TextBox ID="txtPassword" runat="server" CssClass="field" TextMode="Password" ValidationGroup="add" >
        </asp:TextBox>
        <telerik:RadButton ID="btnAddAdmin" runat="server" Text="- Add -" OnClick="btnAdd_Click" ValidationGroup="add">
        </telerik:RadButton>
    </telerik:RadAjaxPanel>
    <p />
    
    <hr class="clear-contentunit" />
    <telerik:RadGrid AutoGenerateColumns="False" ID="grvAdministrators" AllowFilteringByColumn="True" PageSize="20" AllowAutomaticDeletes="true"
        AllowPaging="True" AllowSorting="True" runat="server" Width="990px" OnDeleteCommand="grvAdministrator_OnItemDelete">
        <PagerStyle Mode="NextPrevAndNumeric" />
        <GroupingSettings CaseSensitive="false" />
        <MasterTableView TableLayout="Fixed" runat="server" AllowPaging="true" PageSize="10" DataKeyNames="AdminID">
            <Columns>
                <telerik:GridBoundColumn HeaderText="Tên Tài Khoản" DataField="AdminID" UniqueName="AdminID"
                    SortExpression="adminID" HeaderStyle-Width="150px" FilterControlWidth="140px"
                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" ></telerik:GridBoundColumn>
                <telerik:GridButtonColumn ConfirmText="Xóa quản trị viên này?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" UniqueName="DeleteColumn">
                        <ItemStyle HorizontalAlign="Center"/>
                    </telerik:GridButtonColumn>
            </Columns>
            
        </MasterTableView>
    </telerik:RadGrid>
    <hr class="clear-contentunit" />

  <!----------------------------------------------- sử dụng ajax-------------------------------------------->
        <!-- validate -->
    <telerik:RadInputManager ID="RadInputManager1" runat="server">
            <telerik:TextBoxSetting BehaviorID="TextBoxBehavior1" Validation-IsRequired="true">
                <TargetControls>
                    <telerik:TargetInput ControlID="pnlAddAdmin" />
                </TargetControls>
            </telerik:TextBoxSetting>
    </telerik:RadInputManager>
    
    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanelAdmin" />
    
        <!-- rad ajax manager -->
         <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="grvAdministrators">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grvAdministrators" LoadingPanelID="RadAjaxLoadingPanelAdmin" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnAddAdmin">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grvAdministrators" LoadingPanelID="RadAjaxLoadingPanelAdmin" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        </telerik:RadAjaxManager>
        
<!----------------------------------------hết đoạn sử dụng ajax-------------------------------------->
</asp:Content>